" Author: Huanghai
" Email: qianlongwydhh@163.com
" Lastmodified: 2013年 09月 21日 星期六 14:34:09 CST
" Manual:
" 1. you can use <Space> to watch all buffers which help you
" to switch buffer in the normal mode. if you want to switch 
" to buffer 6, first confirm you are in normal mode, then
" type \6 , or <Alt-6> for alternaltive when run in gvim.
"
" 2. every time you can see file format, file encoding, file type,
" buffer number, file address for all, etc. under the screen.
" if you bored of this, type :set laststatus=1 to close it or
" change it in this file in the 64th line.
"
" Notice:
" 1. there is a conflict with user's ftplugin xml.vim, which had
" set a map for <localleader>5 , and I used this to switch
" to the 5th buffer. To solve this, I modified the xml.vim
" to set the <localleader>5 to <localleader>0 because I did
" not use the \0.
"
" 2. in the user's ftplugin, php.vim uses unlet to destroy some
" variable, which caused some error tips just like "E108, 
" b:match_words does not exists!" when I use :bN 
" to switch buffers. through vim's help, I fixed it by 
" using unlet! instead.
"
" 3. why I use \N and A-N together. because A-N does not
" work on the terminal but only work on gvim, so using \N
" for alternaltive. you can change it for your favorite.
" but this problem was solved by add some set in the 
" ~/.inputrc to make Alt work in the terminal

if  &cp
    finish
endif

"autocmd VimEnter,BufNew,BufEnter,BufWritePost,VimResized * call UpdateStatus()
"autocmd VimEnter,BufNew,BufEnter,BufWritePost,VimResized * call UpdateStatus()
"autocmd InsertLeave * call BufEcho()
"noremap  <Esc><Esc>  :call BufEcho()<cr>

"for buffer switch
"nnoremap <Space> :ls<CR>
noremap <Space> :BufExplorer<CR>

"nnoremap \1 1gt
"nnoremap \2 2gt
"nnoremap \3 3gt
"nnoremap \4 4gt
"nnoremap \5 5gt
"nnoremap \6 6gt
"nnoremap \7 7gt
"nnoremap \8 8gt
"nnoremap \9 9gt
"nnoremap \0 :tablast<CR>
"
"nnoremap <A-1> :b1<CR>
"nnoremap <A-2> :b2<CR>
"nnoremap <A-3> :b3<CR>
"nnoremap <A-4> :b4<CR>
"nnoremap <A-5> :b5<CR>
"nnoremap <A-6> :b6<CR>
"nnoremap <A-7> :b7<CR>
"nnoremap <A-8> :b8<CR>
"nnoremap <A-9> :b9<CR>
"
"nnoremap <F9> :call MyStatusToggle()<CR>:<Backspace>
"
"hi NowBuf term=bold ctermfg=Cyan guifg=Cyan guibg=NONE gui=NONE
"hi NowStat term=bold ctermfg=yellow guifg=#d0d090 guibg=NONE gui=NONE
"hi NowInfo term=bold ctermfg=green guifg=DarkYellow guibg=NONE gui=NONE
"
""set statusline=%<%#NowStat#[%{&ff}]\ [%{&enc}]\ %y\ %#NowBuf#%n-%t%h%m%r%#StatusLine#\ [%F]%=%#NowInfo#ascii[%b,0x%B]\ bytes:[%o]\ %l-%v\ %P[%L]
"set statusline=%#NowStat#[%{&ff}]\ [%{&enc}]\ %y\ %#NowBuf#%n-%t%h%m%r%=%#NowInfo#ascii[%b,0x%B]\ bytes:[%o]\ %l-%v\ %P[%L]
"set laststatus=2
"
"function! MyStatusToggle()
"    if &ls != 2
"        set ls=2
"    else
"        set ls=0
"    endif
"endfunction
"
"function! BufEcho()
"    if winnr('$') > 1 
"        return
"    endif
"    redraw
"    let msg = g:bufBStr.g:bufNStr.g:bufAStr
"    echo '{' . &ff.':'.&fenc.':'.&ft.'} '.msg
"endfunction
"
